package com.huatai.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @program: ht-system
 * @description: 用户实体类
 * @author: songxiude
 * @create: 2023-02-02 15:33
 **/
@Data
@TableName("sys_user")
@ApiModel(value = "User实体", description = "用户实体类")
public class User implements Serializable {

	private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id(如果不传表示新增传id表示修改)")
    //@TableId("id")
	@TableField("id")
    private Long id;

    @ApiModelProperty("用户编号")
    //@NotNull(message = "code不能为空")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "用户账号",required = true)
    @NotBlank(message = "用户账号不能为空")
	@Size(min = 8,max = 40,message = "账号长度必须为8到20个字符之间")
    @TableField("account")
    private String account;

    @ApiModelProperty("用户密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("用户昵称")
    @TableField("name")
    private String name;

    @ApiModelProperty("用户真实名称")
    @TableField("real_name")
    private String realName;

    @ApiModelProperty("用户头像")
    @TableField("avatar")
    private String avatar;

    @ApiModelProperty("邮箱")
    @TableField("email")
    @Email(message = "邮箱格式不正确")
    private String email;

    @ApiModelProperty("电话号码")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("用户生日")
    @TableField("birthday")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private LocalDate birthday;

    @ApiModelProperty("性别0未知1男2女")
    @TableField("sex")
    private Integer sex;

    @ApiModelProperty("是否管理员0否1是")
    @TableField("is_admin")
    private Integer isAdmin;

    @ApiModelProperty("部门id")
    @TableField("dept_id")
    private Long deptId;

    @ApiModelProperty("岗位id")
    @TableField("post_id")
    private Long postId;

	@ApiModelProperty("用户皮肤1深色2浅色")
	@TableField("skin")
	private Integer skin;

	@ApiModelProperty("单位id")
	@TableField("unit_id")
	private Long unitId;

	@ApiModelProperty("审核状态0为审核1审核通过2审核拒绝")
	@TableField("check_state")
	private Integer checkState;

	@ApiModelProperty("用户类型1运营账号2平台普通账号")
	@TableField("user_type")
	private Integer userType;

    @ApiModelProperty("创建人用户id")
    @TableField("create_userid")
    private Long createUserid;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty("更新人用户id")
    @TableField("update_userid")
    private Long updateUserid;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty("状态0整除1禁用")
    @TableField("status")
    private Integer status;

//	@ApiModelProperty("逻辑删除")
//	@TableLogic
//	private Integer isDeleted;


}
